﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Xml.Schema;
using System.IO;

namespace Gammar.Digger.SystemFramework
{
    public sealed class ConfigUtility
    {
        //public static string GetApp(string configName,string key)
        //{
          
        //}

        //public static string ReadSchema(string filePath)
        //{
        //    FileStream stream=new FileStream(filePath, FileAccess.Read);
        //    XmlSchema schema= XmlSchema.Read(stream, null);
        //    XmlSchemaAll all = new XmlSchemaAll();
        //    foreach (XmlSchemaElement element in schema.Elements)
        //    {
        //        //element.
        //    }
        //}

        /// <summary>
        /// 获取config key的值
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetAppSetting(string key)
        {
            return ConfigurationManager.AppSettings[key];
        }

        public static string GetConnectionString(string key)
        {
            return ConfigurationManager.ConnectionStrings[key].ConnectionString;
        }
    }
}
